
<!DOCTYPE html>

<html>
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>&lt;no title&gt; &#8212; CleverHans  documentation</title>
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
    <script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
    <script src="_static/jquery.js"></script>
    <script src="_static/underscore.js"></script>
    <script src="_static/doctools.js"></script>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
   
  <link rel="stylesheet" href="_static/custom.css" type="text/css" />
  
  
  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />

  </head><body>
  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          

          <div class="body" role="main">
            
  <p># Generate documentation</p>
<p>To generate the documentation do:
<cite>make github</cite></p>
<p>The documentation files will be copied to the <cite>cleverhans/docs</cite> directory.</p>
<p>### Preparation</p>
<p>Please do:
<cite>pip install sphinx</cite></p>
<p>Add a <cite>.nojekyll</cite> file in the <cite>cleverhans/docs</cite> directory. When GitHub sees
a <cite>.nojekyll</cite> file, it serves the root <cite>index.html</cite> file. The <cite>.nojekyll</cite> file
indicates that we are not using Jekyll as our static site generator in this
repository.</p>
<p>### Enable GitHub Pages for the GitHub repository</p>
<ol class="arabic simple">
<li><p>Go to the repository on the GitHub website and make sure you are logged in.</p></li>
<li><p>Add a /docs directory to the master branch. Otherwise you do not get the
master branch /docs folder for the Source option in the drop-down list.</p></li>
<li><p>Click the Settings tab. You first go to the Options section.</p></li>
<li><p>Scroll down to the GitHub Pages section and choose the drop-down list under
Source. Note: Your choices will differ based on whether you’re in a User repo
or an Org repository.</p></li>
<li><p>To keep source and output HTML separate, choose master branch /docs folder
for Source.</p></li>
</ol>
<p>### Build Sphinx locally and publish on GitHub Pages</p>
<p>We keep the source docsource and output docs separate, but still are able to
publish on GitHub Pages and preview builds locally.</p>
<p>We have the following option in the Makefile:</p>
<dl class="simple">
<dt><a href="#id1"><span class="problematic" id="id2">``</span></a><a href="#id3"><span class="problematic" id="id4">`</span></a></dt><dd><dl class="simple">
<dt>github:</dt><dd><p>&#64;make html
&#64;cp -a _build/html/. ../docs</p>
</dd>
</dl>
</dd>
</dl>
<p><a href="#id5"><span class="problematic" id="id6">``</span></a><a href="#id7"><span class="problematic" id="id8">`</span></a></p>
<p>Thus, we can run <cite>make github</cite> from the <cite>docsource</cite> directory to generate a
local preview and move the docs where GitHub wants to serve them from.</p>
<p>### Hacks</p>
<p>If you cannot build the docs for attacks, uncomment
<cite>import tensorflow_addons as tfa</cite> in <cite>cleverhans/attacks/spsa.py</cite>.</p>
<p>Otherwise:</p>
<p><code class="docutils literal notranslate"><span class="pre">`angular2html</span>
<span class="pre">WARNING:</span> <span class="pre">autodoc:</span> <span class="pre">failed</span> <span class="pre">to</span> <span class="pre">import</span> <span class="pre">module</span> <span class="pre">'attacks'</span> <span class="pre">from</span> <span class="pre">module</span> <span class="pre">'cleverhans';</span> <span class="pre">the</span> <span class="pre">following</span> <span class="pre">exception</span> <span class="pre">was</span> <span class="pre">raised:</span>
<span class="pre">cannot</span> <span class="pre">import</span> <span class="pre">name</span> <span class="pre">'keras_tensor'</span>
<span class="pre">`</span></code></p>
<p>It is convenient to create a virtual environment to install all the specific
libraries (e.g. virutalen cleverhans).</p>


          </div>
          
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
<h1 class="logo"><a href="index.html">CleverHans</a></h1>








<h3>Navigation</h3>
<ul>
<li class="toctree-l1"><a class="reference internal" href="source/attacks.html"><cite>attacks</cite> module</a></li>
<li class="toctree-l1"><a class="reference internal" href="source/model.html"><cite>model</cite> module</a></li>
</ul>

<div class="relations">
<h3>Related Topics</h3>
<ul>
  <li><a href="index.html">Documentation overview</a><ul>
  </ul></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" />
      <input type="submit" value="Go" />
    </form>
    </div>
</div>
<script>$('#searchbox').show(0);</script>








        </div>
      </div>
      <div class="clearer"></div>
    </div>


  </body>
</html>